<template>
  <div>
    <el-card class="baseData">
      <!-- 返回操作 -->
      <div slot="header" class="clearfix baseData_header">
        <i></i>
        <h2>返回</h2>
      </div>
      <div class="baseData_body">
        <!-- tab栏 -->
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="基本资料" name="first">
            <h2>基本资料</h2>
            <!-- 基本资料 -->
            <el-form :label-position="labelPosition" label-width="90px" :model="formmanageBase">
              <el-form-item label="会员id:">
                <el-input v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <el-form-item label="昵称:">
                <el-input v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <el-form-item label="密码:">
                <el-input type="password" v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <el-form-item label="头像:">
                <el-upload
                  class="upload-demo"
                  action="https://jsonplaceholder.typicode.com/posts/"
                  :on-remove="handleRemove"
                  :show-file-list="false"
                  :on-success="handleSuccess"
                  :before-remove="beforeRemove"
                  multiple
                  :limit="3"
                  :on-exceed="handleExceed"
                >
                  <div class="baseData_upload">
                    <i></i>
                    <span>选择图片</span>
                  </div>
                </el-upload>
              </el-form-item>
              <el-form-item label="手机号码:">
                <el-input v-model="formmanageBase.id"></el-input>
                <span class="noSelect">[更换手机]</span>
              </el-form-item>
              <el-form-item label="性别:">
                <el-input v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <el-form-item label="职业:">
                <el-input v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <el-form-item label="邮箱:">
                <el-input v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <el-form-item label="地址:">
                <el-input v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <h2>管理员操作</h2>
              <el-form-item label="是否禁用:">
                <el-radio v-model="forbidden" label="1">正常</el-radio>
                <el-radio v-model="forbidden" label="2">禁用</el-radio>
              </el-form-item>
              <el-form-item label="可用积分:">
                <el-input v-model="formmanageBase.id"></el-input>
                <span class="noSelect">[改变积分]</span>
              </el-form-item>
              <el-button type="primary">保存</el-button>
            </el-form>
          </el-tab-pane>
          <!-- 配置管理 -->
          <el-tab-pane label="配置管理" name="second">
            <el-form :label-position="labelPosition" label-width="90px" :model="formmanageBase">
              <h2>基本资料</h2>
              <el-form-item label="会员id:">
                <el-input v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <el-form-item label="开启时间:">
                <el-input v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <el-form-item label="会员等级:">
                <el-input type="password" v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <el-form-item label="到期时间:">
                <el-input v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <h2>管理员操作</h2>
              <el-form-item label="是否禁用:">
                <el-radio v-model="forbidden" label="1">正常</el-radio>
                <el-radio v-model="forbidden" label="2">禁用</el-radio>
              </el-form-item>
              <el-form-item label="软件下载次数:" label-width="125px">
                <el-input v-model="formmanageBase.id"></el-input>
                <div class="day">个/天</div>
              </el-form-item>
              <el-form-item label="素材下载次数:" label-width="125px">
                <el-input v-model="formmanageBase.id"></el-input>
                <div class="day">个/天</div>
              </el-form-item>
              <el-form-item label="视频下载次数:" label-width="125px">
                <el-input v-model="formmanageBase.id"></el-input>
                <div class="day">个/天</div>
              </el-form-item>
              <el-form-item label="图标下载次数:" label-width="125px">
                <el-input v-model="formmanageBase.id"></el-input>
                <div class="day">个/天</div>
              </el-form-item>
              <el-form-item label="远程协助:" label-width="125px">
                <el-input v-model="formmanageBase.id"></el-input>
                <div class="day">次/月</div>
              </el-form-item>
              <el-button type="primary">保存</el-button>
            </el-form>
          </el-tab-pane>
          <!-- 积分管理 -->
          <el-tab-pane label="角色管理" name="third">
            <el-form :label-position="labelPosition" label-width="90px" :model="formmanageBase">
              <h2>基本资料</h2>
              <el-form-item label="会员id:">
                <el-input v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <el-form-item label="积分数量:">
                <el-input v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <h2>管理员操作</h2>
              <el-form-item label="是否禁用:">
                <el-radio v-model="forbidden" label="1">正常</el-radio>
                <el-radio v-model="forbidden" label="2">禁用</el-radio>
              </el-form-item>
              <el-form-item label="技术指导:" >
                <el-input v-model="formmanageBase.id"></el-input>
                <div class="day">次</div>
              </el-form-item>
              <el-form-item label="远程协助:" >
                <el-input v-model="formmanageBase.id"></el-input>
              </el-form-item>
              <el-form-item label="下载速度:" >
                <el-input v-model="formmanageBase.id"></el-input>
                <span class="noSelect">[更改]</span>
              </el-form-item>
              <el-form-item label="积分数量:" >
                <el-input v-model="formmanageBase.id"></el-input>
                <span class="noSelect">[更改]</span>
              </el-form-item>
              <el-button type="primary">保存</el-button>
            </el-form>
          </el-tab-pane>
        </el-tabs>
      </div>
    </el-card>
  </div>
</template>


<script>
export default {
  // tab栏切换
  data() {
    return {
      // tab栏默认选中
      activeName: "first",
      // 基本资料表单
      // 是否禁用
      forbidden: "1",
      //   上传图片
      uploadImg: 0,
      // 靠右对齐
      labelPosition: "right",
      // 用户信息
      formmanageBase: {
        id: ""
      }
    };
  },
  methods: {
    // 点击切换
    handleClick(tab, event) {
      console.log(tab, event);
    },
    // 基本资料
    backClick() {
      this.$router.go(-1);
    },
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handleExceed(files, fileList) {
      this.$message.warning(
        `当前限制选择 3 个文件，本次选择了 ${
          files.length
        } 个文件，共选择了 ${files.length + fileList.length} 个文件`
      );
    },
    handleSuccess(response, file, fileList) {
      console.log(response);
      console.log(file);
      console.log(fileList);
      this.uploadImg = fileList.length;
      console.log(this.uploadImg);
    },
    beforeRemove(file, fileList) {
      return this.$confirm(`确定移除 ${file.name}？`);
    }
  }
};
</script>

<style>
/* 头部信息 */
.baseData_header {
  margin-top: 16px;
  margin-left: 50px;
  position: relative;
  /* border-bottom: 1px solid red; */
}
.baseData_header h2 {
  display: inline-block;
  margin: 0;
  margin-left: 12px;
  /* position: absolute; */
  font-size: 20px;

  font-weight: 400;

  color: #3f51b5;
}
.baseData_header i {
  /* position: absolute;
  top: 5px;
  left: 0; */
  display: inline-block;
  width: 10px;
  height: 20px;
  background: url("../assets/img/left.png") no-repeat;
  background-size: 10px 20px;
  vertical-align: middle;
}
/* tab */
.baseData .el-card__body {
  margin: 8px 80px 34px;
}
.baseData .el-tabs__item.is-active {
  background-color: #3040a0;
  color: #fff;
  border-radius: 5px 5px 0 0;
}
.baseData .el-tabs--top .el-tabs__item.is-top:nth-child(2) {
  padding-left: 20px;
}
.baseData .el-tabs--top .el-tabs__item.is-top:last-child {
  padding-right: 20px;
}
.baseData .el-tabs__nav-wrap::after {
  background-color: #3040a0;
}
.baseData .el-tabs__active-bar {
  background-color: #3040a0;
}
/* 基本资料 */
.baseData_body h2 {
  border-left: 4px solid #3f51b5;
  font-size: 20px;
  font-weight: 400;
  padding: 0 14px;
  color: #212121;
  margin: 0;
  margin-top: 19px;
  margin-bottom: 28px;
}
/* label*/
.baseData_body .el-form-item__label {
  font-size: 18px;
  color: #212121;
}
/* 输入框 */
.baseData_body .el-input,
.baseData_upload {
  width: 160px;
  height: 36px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 5px;
}
/* 头像 */
.baseData_body .baseData_upload i {
  display: inline-block;
  width: 28px;
  height: 20px;
  background: url("../assets/img/photo.png") no-repeat;
  background-size: 28px 20px;
  vertical-align: middle;
}
.baseData_body .noSelect {
  font-size: 16px;
  color: #757575;
}
/* 按钮 */
.baseData_body .el-button {
  width: 200px;
  height: 50px;
  background: #3f51b5;
  border-radius: 5px;
  border: none;

  font-size: 24px;
  color: #ffffff;
}

/* 会员管理 */
.baseData_body .day {
  display: inline-block;
  width: 67px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 5px;
}
</style>